using System.Windows.Controls;
using System.Windows.Input;
using CodRevit.ViewModels;

namespace CodRevit.Views
{
    public partial class CozeBotDockablePaneView : UserControl
    {
        public CozeBotDockablePaneView()
        {
            InitializeComponent();
        }

        private void TextBox_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                if (DataContext is CozeBotViewModel viewModel && viewModel.SendMessageCommand.CanExecute(null))
                {
                    viewModel.SendMessageCommand.Execute(null);
                    e.Handled = true;
                }
            }
        }
    }
}